/* tripl/include/tripl/arch.h 
 * 
 * This file is part of tripl. 
 * 
 * tripl is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version. 
 * 
 * tripl is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with tripl. If not, see <https://www.gnu.org/licenses/>
 */ 




#ifndef __TRIPL_ARCH_H__
#define __TRIPL_ARCH_H__


#include <tripl/tripl.h>


struct arch {
	int (* arch_init) (void);
	int (* arch_fin) (void);
	int (* arch_new_var) (char *name, long value, int attr);

	/* interpreter only */
	int (* arch_stack_dump) (void);

	int (* arch_import_shared) (char *name);

	int (* arch_funcall) (char *funcname, struct arg_entry *args);
	int (* arch_set_var) (char *name, long value);
};


struct context {
	char 		*funcname;

	/* prev context */
	struct context 	*link;

	void 		*private_data;
};


__arch_templ int arch_do_keyword(char *p, struct arch *arch_fn);


#endif

